Ext.ns('ru.proburo.oms.order.dao');

/**
 * ru.proburo.oms.order.dao.OrderLineStore
 * @extends Ext.data.GroupingStore
 */
ru.proburo.oms.order.dao.MultiplicityStore = Ext.extend(Ext.data.JsonStore, {
    constructor: function(config)
	{
		config = config || {};
		
        Ext.applyIf(config, {
            url:    '/catalogue/mux.json',
            // reader configs
            root:       'items',
            idProperty: 'item_id',
			fields:     ru.proburo.oms.order.entities.Multiplicity
        });
        
		ru.proburo.oms.order.dao.MultiplicityStore.superclass.constructor.call(this, config);
    },
    
    load: function(sales_direction, items)
    {
        this.setBaseParam('items',           Ext.encode(items));
        this.setBaseParam('sales_direction', sales_direction);
        this.setBaseParam('warehouse',       '1.01');
        
        ru.proburo.oms.order.dao.MultiplicityStore.superclass.load.call(this);
    }
});
